#define _CRT_SECURE_NO_WARNINGS 1
#include"snake.h"
#include<locale.h>

void test() {
	int ch = 0;
	do {
		system("cls");
		//创建贪吃蛇
		Snake snake = { 0 };
		//初始化游戏
		GameStart(&snake);
		//运行游戏
		GameRun(&snake);
		//游戏善后工作
		GameEnd(&snake);
		Setpos(20, 15);
		printf("再来一局吗(Y/N):");
		ch = getchar();
		while (getchar() != '\n');
	} while (ch == 'Y' || ch== 'y');
	Setpos(0, 27);
}

int main(){
	setlocale(LC_ALL, "");
	srand((unsigned int)time(NULL));
	test();
	return 0;
}